package org.zhouhe.vo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OrderBy;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * HotProject entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "hot_project", catalog = "zpd0t1_db")
public class HotProject implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = -7688052307531304932L;
	private Integer hotProjectId;
	private User user;
	private Industry industry;
	private Investment investment;
	private String title;
	private Timestamp displayTime;
	private Double price;
	private String address;
	private String content;
	private Timestamp createTime;
	private Timestamp updateTime;
	private Integer status;
	private Set<HotProjectRegion> hotProjectRegions = new HashSet<HotProjectRegion>(0);

	// Constructors

	/** default constructor */
	public HotProject() {
	}

	/** full constructor */
	public HotProject(User user, Industry industry, Investment investment, String title, Timestamp displayTime, Double price, String address,
			String content, Timestamp createTime, Timestamp updateTime, Integer status, Set<HotProjectRegion> hotProjectRegions) {
		this.user = user;
		this.industry = industry;
		this.investment = investment;
		this.title = title;
		this.displayTime = displayTime;
		this.price = price;
		this.address = address;
		this.content = content;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.status = status;
		this.hotProjectRegions = hotProjectRegions;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "hot_project_id", unique = true, nullable = false)
	public Integer getHotProjectId() {
		return this.hotProjectId;
	}

	public void setHotProjectId(Integer hotProjectId) {
		this.hotProjectId = hotProjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Industry_id")
	public Industry getIndustry() {
		return this.industry;
	}

	public void setIndustry(Industry industry) {
		this.industry = industry;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "investment_id")
	public Investment getInvestment() {
		return this.investment;
	}

	public void setInvestment(Investment investment) {
		this.investment = investment;
	}

	@Column(name = "title", length = 128)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "display_time", length = 19)
	public Timestamp getDisplayTime() {
		return this.displayTime;
	}

	public void setDisplayTime(Timestamp displayTime) {
		this.displayTime = displayTime;
	}

	@Column(name = "price", precision = 18)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "content", length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_time", length = 19)
	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "hotProject")
	@OrderBy("hotProjectRegionId")
	public Set<HotProjectRegion> getHotProjectRegions() {
		return this.hotProjectRegions;
	}

	public void setHotProjectRegions(Set<HotProjectRegion> hotProjectRegions) {
		this.hotProjectRegions = hotProjectRegions;
	}

}